<template>
	<view>
		<view class="empty-content" :style="{ top: dynamicTop }" v-if="fullPage">
			<image class="empty-content-image" :src="src" mode="aspectFit"></image>
			<view class="empty-content-txt text-gray">{{txt}}</view>
			<view v-if="show" class="bg-yijia padding-lr margin-top-xs text-lg" @click="toUrl">去逛逛</view>
		</view>
		<view class="empty-content2" v-else>
			<image class="empty-content-image" :src="src" mode="aspectFit"></image>
			<view class="empty-content-txt text-gray">{{txt}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			src: {
				type: String,
				default: '/static/goods/empty.png'
			},
			txt: {
				type: String,
				default: '暂无相关数据~'
			},
			show: {
				type: Boolean,
				default: false
			},
			fullPage:{//全屏
				type: Boolean,
				default: true
			},
			dynamicTop:{
				type: String,
				default: '-100rpx'
			}
		},

		data() {
			return {
				
			}
		},
		methods:{
			toUrl() {
				uni.switchTab({
					url:'/pages/index/index'
				})
			}
		}
	}
</script>

<style lang="scss">
	.empty-content {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		background: #fff;
		// background: #f5f5f5;
		padding-bottom: 120rpx;
	}
	.empty-content2{
		text-align: center;
		padding-top: 50rpx;
	}
	.empty-content-image {
		width: 300rpx;
		height: 300rpx;
	}
	.empty-content-txt{
		color: #999;
		margin-top: 20rpx;
	}
</style>
